// JavaScript Document
function retiraCaractere(obj) {
    if(obj.value.indexOf("'")>=0){
        obj.value = obj.value.replaceAll("'","");
    }
}

function retiraCaractere(valor,valorRetirar) {
    var newValor;
    if(valor.indexOf(valorRetirar)>=0){
        newValor = valor.replaceAll(valorRetirar,"");
    }
    return newValor;
}

function formata_data(obj, prox) {
    switch (obj.value.length) {
        case 2:
            obj.value = obj.value + "/";
            break;
        case 5:
            obj.value = obj.value + "/";
            break;
    }
}

String.prototype.replaceAll = function(de, para){
    var str = this;
    var pos = str.indexOf(de);
    while (pos > -1){
		str = str.replace(de, para);
		pos = str.indexOf(de);
	}
    return (str);
}

//valida data
function ValidaData(data) {
    exp = /\d{2}\/\d{2}\/\d{4}/
    if (!exp.test(data.value)) {
        data.value = "";
        alert('Data Invalida!');
        data.select();
    }
    
 
}
